<script>
lang.nav_name = '导航名称';
lang.nav_link = '导航链接';
lang.nav_alias = '英文目录';
</script>

<script>
$(function(){
	$("#cate").change(function() {
		var cate = $(this).val();
		$("#pid").load("{:U('nav/ajax_load_pids?cate=')}"+cate);
	});
});
</script>

<!--编辑导航-->
<div class="dialog_content">
    <form id="info_form" name="info_form" action="{:U('nav/edit')}" method="post">
    <table width="100%" class="table_form" style="margin-bottom:10px">
    	<tr>
          <th width="100">导航类别 :</th>
          <td>
          	<select name="cate" id="cate">
            	<option value="">--请选择类别--</option>
            	{$select_cates}
            </select>
          </td>
        </tr>
        <tr>
            <th width="100">上级导航 :</th>
            <td>
            <select name="pid" id="pid">
                <option value="0">作为一级导航</option>
                {$select_navs}
            </select>
          </td>
        </tr>
        <tr>
        <th>{:L('nav_name')} :</th>
            <td><input type="text" name="name" id="name" class="input-text" value="{$rs('name')}"></td>
        </tr>
        <tr>
            <th>别名 :</th>
            <td><input type="text" name="alias" id="alias" class="input-text" value="{$rs('alias')}"></td>
        </tr>
        <tr>
            <th>英文目录 :</th>
            <td><input type="text" name="dir" id="dir" class="input-text" value="{$rs('dir')}"></td>
        </tr>
        <tr>
            <th>链接 :</th>
            <td><input type="text" name="link" id="link" class="input-text" value="{$rs('link')}" size="35"></td>
        </tr>
        <tr>
            <th>{:L('remark')} :</th>
            <td><textarea name="remark" id="remark" cols="40" rows="2">{$rs('remark')}</textarea></td>
        </tr>
        <tr>
            <th>是否显示 :</th>
            <td>
                <label><input type="radio" name="status" class="radio_style" value="1" {if rs("status")=1}checked="checked"{/if}> {:L('yes')}&nbsp;&nbsp;</label>
                <label><input type="radio" name="status" class="radio_style" value="0" {if rs("status")=0}checked="checked"{/if}> {:L('no')}</label>
            </td>
        </tr>
        <tr>
            <th>是否新窗口 :</th>
            <td>
                <label><input type="radio" name="target" class="radio_style" value="1" {if rs("target")=1}checked="checked"{/if}> {:L('yes')}&nbsp;&nbsp;</label>
                <label><input type="radio" name="target" class="radio_style" value="0" {if rs("target")=0}checked="checked"{/if}> {:L('no')}</label>
            </td>
        </tr>
        <tr>
            <th>是否推荐 :</th>
            <td>
                <label><input type="radio" name="istop" class="radio_style" value="1" {if rs("istop")=1}checked="checked"{/if}> {:L('yes')}&nbsp;&nbsp;</label>
                <label><input type="radio" name="istop" class="radio_style" value="0" {if rs("istop")=0}checked="checked"{/if}> {:L('no')}</label>
            </td>
        </tr>
    </table>
    <input name="id" type="hidden" value="{$rs('id')}">
    </form>
</div>

<script>
$(function(){
	$("#cate").formValidator({onshow:"请选择类别",onfocus:"请选择类别"}).inputValidator({min:1,onerror:"请选择类别"}).defaultPassed();
    $("#name").formValidator({ onshow:lang.please_input+lang.nav_name, onfocus:lang.please_input+lang.nav_name, oncorrect:lang.input_right}).inputValidator({ min:1, onerror:lang.please_input+lang.nav_name}).defaultPassed();
	$("#dir").formValidator({ onshow:lang.please_input+lang.nav_alias, onfocus:lang.please_input+lang.nav_alias, oncorrect:lang.input_right}).inputValidator({ min:0, onerror:lang.please_input+lang.nav_alias}).regexValidator({ regexp:'^[a-zA-Z_]*\\w*$', datatype:'string' }).defaultPassed();
	$("#link").formValidator({ onshow:lang.please_input+lang.nav_link, onfocus:lang.please_input+lang.nav_link, oncorrect:lang.input_right}).inputValidator({ min:0, onerror:lang.please_input+lang.nav_link}).defaultPassed();
});
</script>